<!-- 组件 - 新增/编辑 -->
<template>
  <BaseForm
    style="width: 600px"
    v-model="modelData"
    :fields="fields"
    :fetch="data ? PatchMockCommon : PostMockCommon"
    :afterSuccess="() => refreshList?.()"
    :extraParams="data ? { id: data.id } : undefined"
  >
  </BaseForm>
</template>
<script lang="ts" setup>
import { FormField } from "@/core/components/form/_types";
import { PostMockCommon, PatchMockCommon } from "@/api-mock";
import { CommonObj, FinallyNext } from "@/core/_types";
const props = withDefaults(
  defineProps<{
    data?: CommonObj;
    refreshList?: FinallyNext;
  }>(),
  {}
);
const modelData = reactive<CommonObj>({ ...props.data });
const fields: FormField[] = [
  {
    prop: "ffdx",
    label: "待完善",
    required: true,
    // attrs: {
    //   type: "textarea",
    // },
    // quickAttrs: {
    //   tips: "多个用户用，分隔",
    // },
  },
  // {
  //   prop: "ffje",
  //   label: "发放金额",
  //   required: true,
  //   type: "input-number",
  // },
  // {
  //   prop: "imtz",
  //   label: "IM通知",
  //   attrs: {
  //     type: "textarea",
  //   },
  // },
  // {
  //   prop: "bz",
  //   label: "备注",
  //   required: true,
  //   attrs: {
  //     type: "textarea",
  //   },
  // },
];
</script>
<style lang="scss" scoped></style>
